package com.springmvc.controller;

import com.springmvc.annotation.RequestMapping;
import com.springmvc.annotation.ResponseBody;
import com.springmvc.pojo.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

public class UserController {

    @RequestMapping("/user/hello")
    public String hello(){
        return "hello";
    }

    @RequestMapping("/user/findUsers")
    @ResponseBody
    public List<User> findUsers(HttpServletRequest req,
                                HttpServletResponse resp){
        List<User> users = new ArrayList<>();
        users.add(new User(1,"周琪","love"));
        return users;
    }
}
